package com.fsserver.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.HashMap;
import java.util.Map;

/**
 * 订单号配置类
 * 用于配置订单号生成的相关参数
 * 
 * @author fsserver
 * @date 2025-03-13
 */
@Configuration
@ConfigurationProperties(prefix = "pay.order-no")
public class OrderNoConfig {
    
    /**
     * 是否启用分布式ID生成
     * 默认为false，使用本地生成
     */
    private boolean enableDistributed = false;
    
    /**
     * 数据中心ID (0-31)
     * 用于分布式ID生成
     */
    private long dataCenterId = 0;
    
    /**
     * 工作节点ID (0-31)
     * 用于分布式ID生成
     */
    private long workerId = 0;
    
    /**
     * 支付类型映射
     * 用于自定义支付类型代码
     */
    private Map<String, String> paymentTypeMapping = new HashMap<>();
    
    /**
     * 业务类型前缀映射
     * 用于自定义业务类型前缀
     */
    private Map<String, String> businessTypeMapping = new HashMap<>();
    
    public boolean isEnableDistributed() {
        return enableDistributed;
    }
    
    public void setEnableDistributed(boolean enableDistributed) {
        this.enableDistributed = enableDistributed;
    }
    
    public long getDataCenterId() {
        return dataCenterId;
    }
    
    public void setDataCenterId(long dataCenterId) {
        this.dataCenterId = dataCenterId;
    }
    
    public long getWorkerId() {
        return workerId;
    }
    
    public void setWorkerId(long workerId) {
        this.workerId = workerId;
    }
    
    public Map<String, String> getPaymentTypeMapping() {
        return paymentTypeMapping;
    }
    
    public void setPaymentTypeMapping(Map<String, String> paymentTypeMapping) {
        this.paymentTypeMapping = paymentTypeMapping;
    }
    
    public Map<String, String> getBusinessTypeMapping() {
        return businessTypeMapping;
    }
    
    public void setBusinessTypeMapping(Map<String, String> businessTypeMapping) {
        this.businessTypeMapping = businessTypeMapping;
    }
} 